/* 绩效-等级设置 */
import { ajaxService } from '@/utils/request';
import * as typeObj from './type';

const env = import.meta.env;
const baseURL = env.VITE_DEV_BASE_URL;

/**
 * 获取绩效等级列表
 * @param params
 * @returns
 */
export function GetPerformanceLevelList(params?: any) {
  return ajaxService({
    url: '/hr/performance/basic_setting/examine_setting/level_setting/level/list',
    method: 'get',
    baseURL: baseURL,
    params
  });
}
/**
 * 绩效等级查重
 * @param params
 * @returns
 */
export function GetPerformanceLevelRepeat(params: { name: string }) {
  return ajaxService({
    url: '/hr/performance/basic_setting/examine_setting/level_setting/level/repeat',
    method: 'get',
    baseURL: baseURL,
    params
  });
}
/**
 * 获取绩效等级规则设置
 * @param params
 * @returns
 */
export function GetPerformanceLevelSetting() {
  return ajaxService({
    url: '/hr/performance/basic_setting/examine_setting/level_setting/setting/info',
    method: 'get',
    baseURL: baseURL
  });
}

/**
 * 删除绩效等级
 * @param data
 * @returns
 */
export function DelPerformanceLevel(data: { ids: number[] }) {
  return ajaxService({
    url: '/hr/performance/basic_setting/examine_setting/level_setting/level/delete',
    method: 'delete',
    baseURL: baseURL,
    data
  });
}

/**
 * 新增绩效等级
 * @param data
 * @returns
 */
export function PostPerformanceLevel(data: typeObj.PerformanceLevel) {
  return ajaxService({
    url: '/hr/performance/basic_setting/examine_setting/level_setting/level/add',
    method: 'post',
    baseURL: baseURL,
    data
  });
}

/**
 * 修改绩效等级基础信息
 * @param data
 * @returns
 */
export function PutPerformanceLevel(data: typeObj.PerformanceLevel) {
  return ajaxService({
    url: '/hr/performance/basic_setting/examine_setting/level_setting/level/update',
    method: 'put',
    baseURL: baseURL,
    data
  });
}
/**
 * 修改绩效等级status
 * @param data
 * @returns
 */
export function PutPerformanceLevelStatus(
  data: typeObj.PerformanceLevelStatus
) {
  return ajaxService({
    url: '/hr/performance/basic_setting/examine_setting/level_setting/setting/update',
    method: 'put',
    baseURL: baseURL,
    data
  });
}
